<?php
require_once('EmsModelObject.php');
require_once('Address.php');
class Location extends EmsModelObject
{	
	private $locationName;
	public function LocationName($value)
	{
	    if($value == NULL)
	        return $this->locationName;
	    $this->locationName = $value;        
	            
	}
	
	private $address;
	public function Address($value)
	{
	    if($value == NULL)
	        return $this->address;
	    
	    if(!($value instanceof Address))
	    	throw new Exception("Value is not an instance of ".Address::GetType().". Type is ".get_class($value));
	    
	    $this->address = $value;        
	            
	}
	
	private $description;
	public function Description($value)
	{
	    if($value == NULL)
	        return $this->description;
	    $this->description = $value;        
	            
	}
	
	public function __construct($entity)
	{
		//$this->SetId($entity->idLocation);
		//Map Entity to Object
	}
	
	public function IsValid()
	{
		//Validate...
	}
	
	public function SaveChanges()
	{
		//Save changes to DB...
	}
	
	public static function GetType()
	{
		return __CLASS__;
	}
}

?>